<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form id="form_tipo" name="form_tipo" action="<?php echo url_for('tipo/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_tipo='.$form->getObject()->getIdTipo() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<input type="hidden" name="id_tipo" value="<?php echo $form->getObject()->getIdTipo() ?>" />
<?php endif; ?>
	<?php echo $form->renderHiddenFields() ?>
  <table class="form">
    <tbody>
      <tr><th colspan="2" class="title">Dados tipo</th></tr>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['nm_tipo']->renderLabel() ?></th>
        <td>
          <?php echo $form['nm_tipo'] ?>
          <?php echo form_error('tipo[nm_tipo]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_tipo']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_tipo'] ?>
          <?php echo form_error('tipo[ds_tipo]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['is_default']->renderLabel() ?></th>
        <td>
          <?php echo $form['is_default'] ?>
          <?php echo form_error('tipo[is_default]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['is_special']->renderLabel() ?></th>
        <td>
          <?php echo $form['is_special'] ?>
          <?php echo form_error('tipo[is_special]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['categoria_list']->renderLabel() ?></th>
        <td>
          <?php echo $form['categoria_list'] ?>
          <?php echo form_error('tipo[categoria_list]'); ?>
        </td>
      </tr>
    </tbody>
  </table>


<?php
	comandos_form(
		link_to(
			':: Listar ::',
			'tipo/list',
			array('class' => 'botao')
		),
		submit_tag(':: Salvar ::')
	);
?>
</form>

<script type="text/javascript">
$(document).ready(function(){
	System.formdata.save(new Array("msgAlerta", "Atenção:"));
});
</script>